/*
 * author: hujingfei914@msn.com
 * date: 2010-10-15
 * description: the header file of 3ds aircraft
 */
#pragma once
#include "3DSModel.h"
#include "..\helisys\heli_sys_define\FlyStructDefine.h"

#define MAX_NUMBER_OF_OBJECTS   100

class C3DSAircraft
{
public:
	C3DSAircraft(float x = 0.0f, float y = 0.0f, float z = 0.0f, 
		double xrot = 0.0, double yrot = 0.0, double zrot = 0.0);
	virtual ~C3DSAircraft(void);

	// Update position and orientation
	void updatePositionAndOrientation(UINT nFlags, CPoint point);
	void updatePositionAndOrientation(const FlyState &flyState);

	inline obj_type_ptr getPointerOfObjects(void){return objects;}
	// Setters and getters
	inline void setXrot(double xrot) {xrot_ = xrot;}
	inline double getXrot(void) {return xrot_;}
	inline void setYrot(double yrot) {yrot_ = yrot;}
	inline double getYrot(void) {return yrot_;}
	inline void setZrot(double zrot) {zrot_ = zrot;}
	inline double getZrot(void) {return zrot_;}

	inline void setX(float x) {x_ = x;}
	inline float getX(void) {return x_;}
	inline void setY(float y) {y_ = y;}
	inline float getY(void) {return y_;}
	inline void setZ(float z) {z_ = z;}
	inline float getZ(void) {return z_;}

	inline void setNumberOfObjects(int n) {numberOfObjects = n;}
	void setTextureId(int, unsigned int);
	int getTextureId(int);

	void draw(void);
private:
	double xrot_, yrot_, zrot_;
	double originalXRot, originalYRot, originalZRot;
	// Aircraft's position
	float x_, y_, z_;	
	obj_type objects[MAX_NUMBER_OF_OBJECTS];
	int numberOfObjects;
};
